package io.renren.common.rpc;

import io.renren.common.rpc.config.FeignAuthConfig;
import io.renren.common.rpc.config.FeignFastJsonConfig;
import io.renren.modules.simida.dto.resp.UserHomePageRespDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Auther: miaoguoxin
 * @Date: 2019/11/17 19:19
 * @Description: 调用simida主库
 */
@FeignClient(name = "out-rest-simida",url = "${out-rest.simida-host}", fallback = OutrestSimidaFallback.class,configuration = {FeignAuthConfig.class, FeignFastJsonConfig.class})
public interface OutrestSimidaFeignRpc {

    /**
    * @Description: 查询个人详情
    * @Param:
    * @return:
    * @Author: miaoguoxin
    * @Date: 2019/11/17
    */
    @RequestMapping(value = "/api/outrest/info/{userId}",method = RequestMethod.GET)
    UserHomePageRespDto queryUserInfo(@PathVariable("userId") Long userId);

    /**
    * @Description: 支付补偿操作
    * @Param:
    * @return:
    * @Author: miaoguoxin
    * @Date: 2019/11/22
    */
    @RequestMapping(value = "/api/outrest/compensate_pay/{tradeNo}",method = RequestMethod.POST)
    ApiResult<Boolean> compensatePay(@PathVariable(value = "tradeNo") String tradeNo);

    /**
    * @Description: 执行延迟匹配用户逻辑
    * @Param:
    * @return:
    * @Author: miaoguoxin
    * @Date: 2019/11/29
    */
    @RequestMapping(value = "/api/outrest/match_user_delay/{userId}",method = RequestMethod.POST)
    ApiResult<Boolean> matchUserDelay(@PathVariable(value = "userId") Long userId);

    /**
    * @Description: 刷新全部配置
    * @Param:
    * @return:
    * @Author: miaoguoxin
    * @Date: 2019/12/12
    */
    @RequestMapping(value = "/api/outrest/refresh_all_config",method = RequestMethod.POST)
    ApiResult<Boolean> refreshAllConfig();
}
